Ext.define('App.commons.field.MonthDaysField', {
    extend: 'Ext.form.CheckboxGroup',
    alias: ['widget.MonthDaysField', 'widget.monthdaysfield'],
    columns: 7,
    vertical: false,
    datas: [],
    constructor: function () {
        this.items = [];
        if (!Ext.isArray(this.datas) || this.datas.length == 0) {
            for (var i = 1; i <= 30; i++) {
                this.items.push({
                    xtype: 'checkbox',
                    boxLabel: i + "号",
                    inputValue: (i) + ""
                })
            }
            this.items.push({
                xtype: 'checkbox',
                boxLabel: 'L',
                inputValue: 'L'
            })
        } else {
            for (var i = 0; i < this.datas.length; i++) {
                var data = this.datas[i];
                this.items.push({
                    xtype: 'checkbox',
                    boxLabel: data[0] + "",
                    inputValue: data[1] || data[0]
                })
            }
        }
        this.callParent(arguments);
    }
});